_Pragma("once");

#include <regex>

#include "ExtendDevice.h"
#include "common.h"
#include "VersionInfo.h"
#include "ConfigManager.h"
#include "GuiContext.h"

/**
 * 扫码枪
 * @author lizb
 */
class CodeScanner : public ExtendDevice {
    static const std::regex pattern;
public:

    CodeScanner(DummyChannel& channel, const ExtendDeviceType& deviceType, const std::string& deviceActknowlege): ExtendDevice(channel, deviceType, deviceActknowlege), mpool(GuiContextSingleton::instance().getWorkPool()) {

    }

    void update(const int& command, void* data, const Task* pTask)noexcept override;

    bool recheck() noexcept override;


    bool activeUpdateInformation() override{
        return recheck();
    }


    WorkerBase::PoolType* const mpool;
};
